﻿using Firestarter.DB.Schema.BO;
using FireStarterModeller.Test;
using Habanero.Testability;

namespace Firestarter.DB.Schema.Test.BO.TestUtils
{
    public partial class TestUtilsDBForeignKey
    {


        public static BOTestFactory<DBForeignKey> GetTestFactory()
        {
            return BOTestFactoryRegistry.Instance.Resolve<DBForeignKey>();
        }
        /// <summary>
        /// Creates a new saved DBForeignKey with a random value assigned to every property
        /// </summary>
        public static DBForeignKey CreateSavedDBForeignKey()
        {
            DBForeignKey dBForeignKey = CreateUnsavedValidDBForeignKey();
            dBForeignKey.Save();
            return dBForeignKey;
        }

        /// <summary>
        /// Creates a new unsaved DBForeignKey with a random value assigned to every property
        /// </summary>
        public static DBForeignKey CreateUnsavedValidDBForeignKey()
        {
            DBForeignKey dBForeignKey = new DBForeignKey();
            dBForeignKey.ParentTableID = TestUtilsDBTable.CreateSavedDBTable().TableID;
            dBForeignKey.RelatedTableID = TestUtilsDBTable.CreateSavedDBTable().TableID;
            dBForeignKey.ForeignKeyName = TestUtilsShared.GetRandomString();
//			dBForeignKey.PendingChangeType = null;
            dBForeignKey.Approved = TestUtilsShared.GetRandomBoolean();
            return dBForeignKey;
        }
	    
        /// <summary>
        /// Creates a new unsaved DBForeignKey where all properties are null, except ID properties
        /// and those with default values.  If there are compulsory properties without
        /// defaults, saving the object will throw an exception.
        /// </summary>
        public static DBForeignKey CreateUnsavedDefaultDBForeignKey()
        {
            DBForeignKey dBForeignKey = new DBForeignKey();
            return dBForeignKey;
        }
    }
}